clear
set more off
tempfile temp
set matsize 600

use ${wd}/cps/cps_wd.dta , clear

cap drop if ${area}==.

g E_c = 1 if empl==1
g U_c = 1 if unem==1

collapse (sum) E_c U_c  [pw=wgt], by(year year2 ${area} ${ind})
collapse (mean) E_c U_c , by(year2 ${area} ${ind})
collapse (sum) E_c U_c , by(year2 ${area})

* Other Variables
gen EP_c = E_c/(E_c+U_c)
gen lnEP_c = log(EP_c)
	
sort year2 ${area} 
keep lnEP_c year2 ${area}

save ${wd}/keyvars/emp.dta, replace


